"""
@Time: 2021/1/24 下午 9:09
@Author: jinzhuan
@File: fn_toolkit.py
@Desc: 
"""
import torch
from cognlp import *


torch.cuda.set_device(4)
tokenize_toolkit = TokenizeToolkit()
words = tokenize_toolkit.run('The true voodoo-worshipper attempts nothing of importance without certain sacrifices which are intended to propitiate his unclean gods.')

fn_toolkit = FnToolkit(
    bert_model='bert-base-cased',
    model_path='../../../cognlp/data/fn/framenet/toolkit/model.pt',
    vocabulary_path='../../../cognlp/data/fn/framenet/toolkit/frame_vocabulary.txt',
    device=torch.device("cuda"),
    device_ids=[4],
    max_seq_length=256)

fn_result = fn_toolkit.run(words)
print(fn_result)
